Music reproducing apparatus and method and cellular terminal apparatus

ABSTRACT

There is provided a musical tone reproducing apparatus which is capable of recovering proper timing of musical tone generation even in a situation where processing of events takes much time such that the sounding timing of musical tones is delayed. Duration data read out from a FIFO  30  are added together by a duration forward counter  32   b . A comparator circuit  32   d  compares the count value of an absolute time counter  32   c  and the count value of the duration forward counter  32   b , and delivers the comparison result i to a FIFO controller  3  when the former becomes equal to or more than the latter. The FIFO controller  31  causes the FIFO  30  to read out event information and delivers the same to a decoder  32   a , which in turn converts the event information into tone generator control data having a format peculiar to a tone generator  33  and delivers the same data to a register write controller  32   e . The register write controller  32   e  writes an associated tone generator parameter into a tone generator control register within the tone generator  33,  and the tone generator  33  reproduces and outputs musical tones based on the tone generator parameter.

BACKGROUND OF THE INVENTION

[0001] 1. Technical Field

[0002] The present invention relates to a musical tone reproducingapparatus and a musical tone reproducing method which can be suitablyapplied to portable terminal apparatuses to generate melody tones.

[0003] 2. Background Art

[0004] Conventional musical tone reproducing apparatuses include a typewhich generates musical tones using hardware.

[0005]FIG. 13 shows an example of the construction of a conventionalmusical tone reproducing apparatus of this type. In FIG. 13, a CPU(Central Processing Unit) 110 controls supply of music contents data111, such as MIDI (Musical Instrument Digital Interface) data and SMAF(Synthetic Music Mobile Application Format) data, hereinafter described,to a tone generator hardware section 15. In this case, the MIDI data andSMAF data are transferred from external apparatuses or read from storagemeans. The tone generator hardware section 115 is comprised of asequencer 132, and a tone generator 133. The sequencer 132 is comprisedof a decoder 132 a that converts sequence data such as MIDI data or SMAFdata into control data having a format peculiar to the tone generator133, and a time management section 132 b that controls musical tonereproduction time according to time management information contained inthe control data.

[0006] In the musical tone reproducing apparatus constructed as above,in reproduction of musical tones, the time management section 132 bgives the decoder 132 a instructions to output the control data forreproduction of musical tones, in timing based on duration dataindicative of time intervals between events contained in the controldata and gate time data indicative of sounding time periods. In responseto the instructions, the decoder 132 a outputs the control data to thetone generator 133. The tone generator 133 in turn generates and outputsmusical tones based on the supplied control data. Thus, musical tonesare reproduced.

[0007] In the conventional musical tone reproducing apparatus, thesequencer 132 carries out conversion of the music contents data and timemanagement. Therefore, in the case where many events occur at the sametime, for example, the processing capacity of the sequencer 132increases, which can result in inability to complete processing of thedata for all the events in a unit time. For example, how the processingis carried out will be described with reference to FIG. 14 in whichabsolute time elapsed during musical tone reproduction is shown on theabscissa. In FIG. 14, reference numerals (1) to (4) represent eventswhich are processed by the sequencer 132. An event (1), to whichduration data “1” is allotted, is to be processed in timing of absolutetime “1”, an event (2) following the event (1), to which duration data“1” is allotted, is to be processed in timing of absolute time “2”, isto be processed in timing of absolute time, an event (3) following theevent (2), to which duration data “1” is allotted, is to be processed intiming of absolute time “3”, and an event (4) following the event (3),to which duration data “5” is allotted, is to be processed in timing ofabsolute time “8”. If the processing is properly carried out inaccordance with the above-mentioned timing, musical tones are reproducedand sounded by the tone generator 188 in proper timing in accordancewith the contents of the sequence data. The absolute times are set interms of unit time.

[0008] However, if it takes much time to carry out processing of theevent (1) so that the processing of this event cannot be completedwithin the unit time and is completed after the absolute time “2”, asindicated as (1) in a lower part of FIG. 14, the event (2) to beprocessed in timing of the absolute time “2” is processed in timing ofthe absolute time “3”, the event (3) to be processed in timing of theabsolute time “3” is processed in timing of the absolute time “4”, andthe event (4) to be processed in timing of the absolute time “8” isprocessed in timing of the absolute time “9”. Thus, the events thatcannot be completely processed within the respective unit times areprocessed in delayed timing. Consequently, if an event cannot becompletely processed within the unit time, the corresponding controldata is supplied to the tone generator 133 in timing delayed from thetime point at which the control data should be properly supplied to thetone generator 133, and accordingly sounding timing of subsequentmusical tones is delayed. Mobile phones in particular have a function ofdisplaying images in synchronism with incoming call music, and afunction of vibrating the casing of the phone and/or lighting on/offvarious buttons in synchronism with incoming call music. In performingsuch functions, if the sounding timing of musical tones is delayed, thefunctions are performed out of synchronism with incoming call music.

[0009] It is therefore an object of the present invention to provide amusical tone reproducing apparatus and a musical tone reproducing methodwhich are capable of recovering proper timing of musical tone generationeven in a situation where processing of events takes much time such thatthe sounding timing of musical tones is delayed, and a portable terminalapparatus having the musical tone reproducing apparatus.

DISCLOSURE OF THE INVENTION

[0010] To attain the above object, the present invention provides amusical tone reproducing apparatus for performing reproduction ofmusical tones based on performance data comprising event informationrepresentative of contents of events and representative of timeintervals between occurrence of events and occurrence of precedingevents, comprising forward counter means for accumulating the durationinformation of the performance data sequentially supplied thereto toindicate time at which musical tones are to be generated based on theevent information corresponding to the duration information, timecounter means for counting up at intervals of a unit time to indicateabsolute time, data generating means operable when a count value of thetime counter means becomes equal to or more than a count value of theforward counter means, for generating control data from the eventinformation corresponding to the accumulated duration data of theperformance data, and tone generator means for generating musical tonesbased on the control data generated by the data generating means.

[0011] In a preferred form of the present invention, the musical tonereproducing apparatus according to the present invention furthercomprises temporary storage means, and system control means for carryingout a process other than a musical tone reproducing process as a mainprocess, and wherein, when musical tones are to be reproduced, thesystem control means sequentially transfers the performance data by apredetermined amount to the temporary storage means, and sequentiallyreads out the performance data from the temporary storage means.

[0012] To attain the above object, the present invention also provides aportable terminal apparatus having a musical- tone reproducing apparatusconstructed as above, wherein the system control means carries out aportable terminal function process as the main process.

[0013] In a further preferred form of the present invention, the musicaltone reproducing apparatus according to the present invention furthercomprises temporary storage means control means for controlling thetemporary storage means to read out the performance data and transferthe readout performance data to the data generating means when the countvalue of the time counter means becomes equal to or more than the countvalue of the forward counter means.

[0014] To attain the above object, the present invention furtherprovides a musical tone reproducing method of performing reproduction ofmusical tones based on performance data comprising event informationrepresentative of contents of events and duration informationrepresentative of time intervals between occurrence of events andoccurrence of preceding events, comprising the steps of accumulating theduration information of the performance data sequentially supplied todetermine time at which musical tones are to be generated based on theevent information corresponding to the duration information, counting upat intervals of a unit time to indicate absolute time, generatingcontrol data from the event information corresponding to the accumulatedduration data of the performance data when the determined absolute timebecomes equal to or later than the determined time, and causing a tonegenerator to generate musical tones based on the generated control data.

[0015] With the above constructions according to the present invention,since when the count value of the time counter means becomes equal to ormore than the count value of the forward counter means, the control datagenerated from the corresponding event information is supplied to thetone generator means, even if there occurs a temporary delay in thesupply of the control data in the course of musical tone reproduction,thereafter the control data can be supplied to the tone generator intiming indicated by the duration information. As a result, the timing ofsounding of musical tones reproduced by the tone generator can berestored to proper or original timing.

[0016] Therefore, even when in a mobile phone to which the presentinvention is applied, an image is displayed, the casing of the mobilephone is vibrated, or various buttons are lighted on and off insynchronism with the reproduction of incoming call music, a delay in thesounding timing of musical tones can be eliminated to again bring theseoperations into synchronism with the reproduction of the generation ofmusical tones.

BRIEF DESCRIPTION OF THE DRAWINGS

[0017]FIG. 1 is a diagram showing the construction of a mobile phonehaving a musical tone reproducing apparatus according to an embodimentof the present invention, to which is applied the present invention;

[0018]FIG. 2 is a diagram showing the construction of the musical tonereproducing apparatus according to the embodiment of the presentinvention;

[0019]FIGS. 3A and 3B are diagrams showing the structure of SMAF dataand the structure of score track chunk data in the SMAF data structure,respectively;

[0020]FIG. 4 is a diagram showing the structure of data of sequence datachunk in the score track chunk data in SMAF;

[0021]FIG. 5 is a diagram showing the sequence data in an example of theSMAF data, plotted along the time axis:

[0022]FIG. 6 shows an example of the sequence data used by the musicaltone reproducing apparatus;

[0023]FIG. 7 is a diagram showing timing of processing carried out bythe musical tone reproducing apparatus;

[0024]FIG. 8 is a diagram showing another example of the timing ofprocessing carried out by the musical tone reproducing apparatus;

[0025]FIG. 9 is a flow chart showing a reproduction process carried outby the musical tone reproducing apparatus;

[0026]FIG. 10 is a flow chart of an absolute time updating process inthe reproduction process carried out by the musical tone reproducingapparatus;

[0027]FIG. 11 is a flow chart showing a control register write processin the reproduction process carried out by the musical tone reproducingapparatus;

[0028]FIG. 12 is a flow chart showing a sounding process in thereproduction process carried out by the musical tone reproducingapparatus;

[0029]FIG. 13 is a diagram showing an example of the construction of aconventional musical tone reproducing apparatus; and

[0030]FIG. 14 is a diagram showing an example of timing of processingcarried out by the conventional musical tone reproducing apparatus.

BEST MODE OF CARRYING OUT THE INVENTION

[0031] The present invention will now be described in detail withreference to the drawings showing a preferred embodiment thereof.

[0032]FIG. 1 is a diagram showing the construction of a mobile phonehaving a musical tone reproducing apparatus according to an embodimentof the present invention, to which is applied the present invention.

[0033] The mobile phone 1 shown in FIG. 1, which generally has aretractable antenna 25, can be connected to a base station 2 by awireless communication line. The antenna 25 is connected to acommunication section 13 having functions of modulation anddemodulation. A CPU (Central Processing Unit) 10 serves as a systemcontrol section that controls operations of various sections of themobile phone 1 by executing telephone function programs, and is providedwith a timer that shows elapsed time in the operations and generates atimer interrupt at predetermined time intervals. Further, the CPU 10transfers music contents data in predetermined amounts to a tonegenerator hardware section 15 during musical tone reproduction carriedout upon receipt of an incoming call, for example. A RAM (Random AccessMemory) 11 has a storage area for music contents data having a deliveryformat downloaded from a download center or the like connected to anetwork via the base station 2, and a work area for the CPU 10. A ROM 12stores various programs including various phone function programs forcarrying out transmission and reception functions, and programs forcarrying out musical tone reproduction and the like, and various kindsof data such as preset music contents data.

[0034] The communication section 13 demodulates a signal received by theantenna 25 and modulates and supplies a signal to be transmitted to theantenna 25. An incoming speech signal demodulated by the communicationsection 13 is decoded by a speech processing section (coder/decoder) 14,and a speech signal inputted via a microphone 21 is compression decodedby the speech processing section 14. The speech processing section 14,which subjects a speech signal to high efficiency compressionencoding/decoding, is provided with a coder/decoder of the CELP (CodeExcited LPC) system or the ADPCM (Adaptive Differential PCMCoding)system. A tone generator hardware section 15 is adapted to soundthe incoming speech signal from the speech processing section 14 througha loud speaker 22 for speech, and generate and output incoming callmusic and a hold tone by reproducing the musical contents data when acall is received. The incoming call music is outputted from a loudspeaker 23 for incoming calls, and the hold tone is mixed with theincoming speech signal and is outputted from the loud speaker 22 forspeech.

[0035] The music contents data has a MIDI (Musical Instrument DigitalInterface) format or a SMAF (Synthetic Music Mobile Application Format)format convenient for delivery. The tone generator hardware section 15converts music contents data of these formats into control data of aformat peculiar to the tone generator hardware section 15 and reproducesthe converted data. Alternatively, the CPU 10 may convert the musiccontents data of the above formats into control data of a formatpeculiar to the tone generator hardware section 15, stores the converteddata in the RAM 11 and read out the same from the RAM 11 and supply thesame to the tone generator hardware section 15 during reproduction. Thetone generator hardware section 5 has provided therein a FIFO thattemporarily stores a predetermined amount of music contents data. ThisFIFO may have a capacity for storing music contents data for one musiccomposition, but if the capacity of the FIFO is so small that musiccontents data for one music composition cannot be stored in the FIFO, itmay be arranged such that when an empty area of a predetermined amountof data occurs in the FIFO, the tone generator hardware section 15delivers a FIFO data request signal to the CPU 10, and then the CPU 10reads out a continued part of the music contents data stored in the RAM11 or the ROM 12 and transfers the same to the tone generator hardwaresection 15. By this alternative arrangement, even if a small-capacityFIFO is used, a music composition based on a large amount of musiccontents data can be reproduced.

[0036] An interface (I/F) 16 is for downloading music contents data andthe like from an external apparatus 20 such as a personal computer. Aninput section serves as input means comprised of dial buttons fornumerical values “0” to “9” and various other buttons provided in thepresent mobile phone 1. A display section 18 is comprised of a displaydevice which performs displays according to operations of buttons suchas menu buttons and the dial buttons for phone functions. A vibrator 19notifies a user of incoming calls by vibrating the main body casing ofthe mobile phone 1 instead of generating incoming call music.

[0037] Next, FIG. 2 shows the construction of the musical tonereproducing apparatus provided in the mobile phone 1 according to thepresent embodiment. In FIG. 2, the constructions of the loud speaker 22for speech, loud speaker 23 for incoming calls, and their related partsare omitted. In FIG. 2, the CPU 10, the tone generator hardware section15 and the RAM 11 are connected to each other via a bus 24 for datatransmission and reception therebetween, though not shown in the figure.

[0038] In the musical tone reproducing apparatus in FIG. 2, the RAM 11stores music contents data such as MIDI and SMAF in the forms of files.The RAM 11 has such a capacity that music contents data for a pluralityof music compositions which are downloaded or read from the externalapparatus 20 can be stored.

[0039] Here, the SMAF format will be described. The structure of SMAFformat data is shown in FIGS. 3A and 3B and FIG. 4. The SMAF data shownin FIG. 3A is comprised of a plurality of chunks such as a contentsinformation chunk (Contents Info Chunk) 40, a score track chunk (ScoreTrack Chunk) 41, a PCM audio track chunk (PCM Audio Track Chunk) 42, andso forth. The contents information chunk 40 contains information oncontents and definitions of the same, the score track chunk 41 storestone generator sequence tracks, and the PCM audio track chunk 42 storescompressed audio sounding data of the PCM system such as ADPCM, MP3(MPEG Audio Layer 3), and TwinVQ in the form of events.

[0040] The structure of the data of the score track chunk 41 is shown inFIG. 3B. As shown in FIG. 3B, the score track chunk 41 is comprised ofdata of a format type (Format Type), a sequence type (Sequence Type),and the like, and chunks such as a setup data chunk (Setup Data Chunk)43 and a sequence data chunk (Sequence Data Chunk) 44. The format typedata indicates a status that defines the real format of this chunk. Forexample, the real format can be defined as handy phone standard. Thesequence type data indicates a type of one of two types of sequencedata, and the type includes a stream sequence type and a sub sequencetype. The setup data chunk 43 stores tone color data, effects-settingdata, and so forth. The sequence chunk 44 stores sequence data which isused as real performance data.

[0041] Next, the structure of the sequence data stored in the sequencedata chunk 44. As shown in FIG. 4, the sequence data is comprised of onebyte of duration (Duration) data, and two or three bytes of event(Event) data, which are alternately arranged. In the illustratedexample, it is assumed that duration data always exists before eachpiece of event data. The duration data is time information indicative ofa time interval between each event located before the duration data andan event located after the duration data. The events include events suchas a note message (Note Message) for controlling sounding, a controlmessage (Control Message) for controlling volume, modulation, and thelike, and an exclusive message (Exclusive Message) for transmittinginformation peculiar to the phone maker. Further, as shown in thefigure, the note message is comprised of data such as a channel number(Channel Number) indicative of designated sounding channels, and a gatetime (Gate Time) indicative of a sounding time period.

[0042] If the sequence data consisting of the duration data 1 to 3 andthe event data 1 to 3 shown in FIG. 4 are plotted along the time axis,they appear as shown in FIG. 5. For example, if the event data 1 to 3indicate, respectively, an event 1, an event 2 and an event 3 as notemessages for note-on, sounding of a musical tone according to the event1 is started upon the lapse of time or duration indicated by theduration data 1. Then, the sounding of the musical tone according to theevent 1 is stopped upon the lapse of time indicated by a gate time 1.Then, sounding of a musical tone according to the event 2 is startedupon the lapse of time indicated by the duration data 2 following thelapse of the time indicated by the duration data 1. Next, the soundingof the musical tone according to the event 2 is stopped upon the lapseof time indicated by a gate time 2 after the start of the soundingaccording to the event 2. Then, sounding of a musical tone according tothe event 3 is started upon the lapse of time indicated by the durationdata 3 following the lapse of the time indicated by the duration data 2.Then, the sounding according to the event 3 is stopped upon the lapse oftime indicated by a gate time 3 after the start of the soundingaccording to the event 3. In the following description, it is assumedthat the musical tone reproducing apparatus according to the presentinvention shown in FIG. 2 reproduces the sequence data shown in FIG. 4.

[0043] The tone generator hardware section 5 appearing in FIG. 2 has aFIFO 30 that temporarily stores a predetermined amount of sequence data.A predetermined amount of sequence data b is read from the RAM 11 andstored in the FIFO 30 under the control of the CPU 10. At this time, theCPU 10 sends a write signal c to the FIFO controller 31, which operatesin response to the write signal c to write the sequence data b read fromthe RAM 11 into the FIFO 30 at a given address location. Then, whenmusical tone reproduction is started in response to a command from theCPU 10, the FIFO controller 31 sends a read signal/address d to the FIFO30, which, in response to the read signal/address d, reads sequence datae from an address location corresponding to the read signal/address dand supplies the same to a sequencer 32. Thus, the FIFO 30 serves as afirst-in first-out storage means from which previously written sequencedata are sequentially read out. If an empty area of a predeterminedamount occurs in the FIFO 30 due to reading-out of sequence data, theFIFO 30 sends a FIFO data request signal to the CPU 10 to requesttransfer of subsequent sequence data. Thus, even if the FIFO 30 has asmall capacity, a musical composition requiring a large amount ofsequence data can be reproduced.

[0044] The sequencer 32 of the tone generator hardware section 15 iscomprised of a decoder 32 a that converts the supplied sequence datainto tone generator control data of a format peculiar to a tonegenerator 33, a register write controller 32 e that writes the tonegenerator control data for musical tone reproduction into a tonegenerator control register of the tone generator 33, a duration forwardcounter 32 b, and a time management section that is comprised of anabsolute time counter 32 c and a comparator circuit 32 d and controls areproduction time for musical tones. The sequence data e read from theFIFO 30 is converted into tone generator control data by the decoder 32a, and out of the converted tone generator control data, duration dataf-1 is delivered to the duration forward counter 32 b, and event dataf-2 is delivered to the register write controller 32 e. The durationdata f-1 at the head of the sequence data forms duration information asshown in FIG. 5, and accordingly the duration data f-1 is firstoutputted from the decoder 32 a, which is delivered to the durationforward counter 32 b. The duration forward counter 32 b adds thedelivered duration data f-1 that indicates a time interval betweenevents concerned to a present count value of the duration forwardcounter 32 b. That is, in the duration forward counter 32 b, durationdata indicative of relative time values are accumulated, the occurrencetime of the corresponding event is indicated in terms of absolute timefrom the start of reproduction of musical tones.

[0045] The absolute time counter 32 c that constitutes the timemanagement section counts up every unit time after the start ofreproduction of musical tones and thus indicates absolute time elapsedfrom the start of reproduction. The absolute time counter 32 c may beconstructed to count up in response to a timer interrupt that generatedat intervals of the unit time. The absolute time counter 32 c deliversan absolute time count value h indicative of absolute time elapsed fromthe start of reproduction of musical tones to the comparator circuit 32d. A count value g indicative of the accumulated duration data (durationabsolute time value) from the duration forward counter 32 b is alsodelivered to the comparator circuit 32 d, which in turn compares thecount value g and the count value h. Here, when the absolute timecounter 32 c repeatedly counts up every unit time so that the countvalue h becomes equal to or more than the count value g, the comparatorcircuit 32 d applies a significant comparison result i to the FIFOcontroller 31. The significant comparison result i means that the timeindicated by the accumulated duration data has been reached. Uponreceiving the significant comparison result i, the FIFO controller 31causes the FIFO 30 to read out the next sequence data corresponding tothe present duration data, which is delivered to the decoder 32 a.

[0046] The sequence data delivered to the decoder 32 a consists of thenext event information following the duration information of the presentduration data and the next duration information. This sequence data isconverted into tone generator control data by the decoder 32 a. Eventdata f-2 contained in the tone generator control data then outputtedfrom the decoder 32 a is delivered to the register control section 32 e,and duration data f-1 contained in the outputted tone generator controldata is added to the count value of the duration forward counter 32 b.The register write controller 32 e carries out control of writing theevent data into the tone generator control register provided in the tonegenerator 33. Specifically, a tone generator parameter contained in theevent data is written as write data j into a register within the tonegenerator control register at an address location of the tone generatorcontrol register indicated by address information contained in the eventdata. When the write data j is written into the tone generator controlregister of the tone generator 33, the tone generator 33 operates basedon the write data j written into the tone generator control register todeliver musical tone reproducing data k to a speaker 34. In this way,when the time indicated by the duration data elapses, a musical tonebased on the event data corresponding to the duration data is reproducedand sounded from the speaker 34.

[0047] When the absolute time counter 32 c counts up every unit time sothat the absolute time count value h again becomes equal to or more thanthe count value g, it means that the time indicated by the furtheraccumulated duration data has been reached. Then, the comparator circuit32 d applies the significant comparison result i to the FIFO controller31. Upon receipt of the significant comparison result i, the FIFOcontroller 31 causes the FIFO 30 to read out the next sequence data anddeliver the same to the decoder 32 a. The delivered sequence dataconsists of event information following the duration information of theabove duration data and the next duration information. The decoder 32 aconverts the delivered sequence data into tone generator control data.Event data f-2 contained in the tone generator control data thenoutputted from the decoder 32 a is delivered to the register controlsection 32 e, and duration data f-1 contained in the outputted tonegenerator control data is added to the count value of the durationforward counter 32 b. A tone generator parameter contained in the eventdata delivered to the register write controller 3 e is written as writedata j into a register within the tone generator control register at anaddress location indicated by address information contained in the eventdata. When the write data j is written into the tone generator controlregister of the tone generator 33, the tone generator 33 operates basedon the write data j written into the tone generator control register todeliver musical tone reproducing data k to a speaker 34.

[0048] In this way, when the time indicated by the duration dataelapses, a musical tone based on the event data corresponding to theduration data is reproduced and sounded from the speaker 34.

[0049] The above described processing is repeatedly carried out thesequence data until the processing of the sequence data is completed.That is, whenever the time indicated by the duration data elapses, thenext event data is read out from the FIFO 30, and a musical tone isreproduced based on the readout event data, and duration data indicativeof timing in which a musical tone based on the next event data is to begenerated is added to the count value of the duration forward counter 32b, whereby musical tones are sequentially reproduced each in timing inwhich the time indicated by the duration data is reached.

[0050] A specific example of this processing will now be described withreference to FIGS. 7 to 9, on the assumption that sequence data shown inFIG. 6 is read out from the FIGO 30.

[0051] In the sequence data shown in FIG. 6, the first event data hasduration information indicative of one unit time “01”. That is, durationdata “01” outputted from the decoder 32 a is added to the count value ofthe duration forward counter 32 b so that the new count value becomes“1”. Thereafter, when one unit time elapses so that the absolute timecounter 32 c counts up by “1” to provide a count value “1”, the countvalue of the duration forward counter 32 b and the count value of theabsolute time counter 32 c become equal to each other, that is, the timeindicated by the duration data has been reached. Accordingly, asignificant comparison result i is outputted from the comparator circuit32 d to the FIFO controller 31, which in turn controls the FIFO 30 toread out event information indicative of “Tone Color Setting 1” as wellas the next duration information indicative of a duration “00”. Thereadout event information indicative of “Tone Color Setting 1” that isfor setting a tone color for a channel 1 is converted into event dataindicating an address corresponding to an associated tone colorparameter by the decoder 32 a, and the converted event data is deliveredto the register write controller 32 e. Then, the register writecontroller 32 e carries out control such that the tone color parameterfor setting the tone color for the channel 1 is written as write data jinto the tone generator control register of the tone generator 33 at alocation indicated by the address of the event data. Thus, the tonecolor of the channel 1 to be reproduced by the tone generator 33 is set.

[0052] The above duration data read out from the FIFO 30 indicates aduration “00”, and therefore the duration forward counter 32 b does notcount up and its count value remains “1”. Consequently, the count valueof the duration forward counter 32 b and the count value of the absolutetime counter 32 c remain equal to each other so that the significantcomparison result i continues to be outputted. Accordingly, the FIFOcontroller 31 causes the FIFO 30 to read out the next event informationindicative of “Tone Color Setting 2” as well as the next durationinformation indicative of a duration “00”. The readout event informationindicative of “Tone Color Setting 2” that is for setting a tone colorfor a channel 2 is converted into event data indicating an addresscorresponding to an associated tone color parameter by the decoder 32 a,and the converted event data is delivered to the register writecontroller 32 e. Then, such that the tone color parameter for settingthe tone color for the channel 2 is written as write data j into thetone generator control register of the tone generator 33 at a locationindicated by the address of the event data. Thus, the tone color of thechannel 2 to be reproduced by the tone generator 33 is set. The aboveprocessing is continuously carried out so long as the durationinformation read out from the FIFO 30 under the control of the FIFOcontroller 31 indicates the duration “00” so that tone color settingprocesses for channels 1 to N as shown in at (1) in FIG. 6 arecontinuously carried out. In other words, the tone color settingprocesses for the channels 1 to N are continuously carried out fromtiming of absolute time “1” as shown in FIG. 7.

[0053] Then, when event information for setting a tone color for thechannel N is read out, duration information indicative of a duration“01” is read out from the FIFO 30 and delivered to the decoder 32 a. Theduration data “01” outputted from the decoder 32 a is added to the countvalue of the duration forward counter 32 b so that the duration forwardcounter 32 b counts up by “1” corresponding to one unit time to providea count value “2”. This stops the significant comparison result i frombeing outputted. Then, the process waits for one unit time to elapse,and upon the lapse of one unit time, the absolute time counter 32 ccounts up by “1” to provide a count value “2”, so that the count valueof the duration forward counter 32 b and the count value of the absolutetime counter 32 e again become equal to each other, whereby thesignificant comparison result i is again outputted from the comparatorcircuit 32 d. Thus, event information indicative of “Volume Setting” isread out from the FIFO 30 under the control of the FIFO controller 31and at the same time the next duration information indicative of aduration “01” is read out from the FIFO 30. The readout eventinformation indicative of “Volume Setting” is converted into event dataindicating an address corresponding to an associated volume parameter bythe decoder 32 a and the converted event data is delivered to theregister write controller 32 e. Then, the volume parameter for setting avolume value is written as write data j into the tone generator controlregister of the tone generator 33 at a location indicated by the addressof the event data. In this way, the volume of musical tones reproducedby the tone generator 33 is controlled to a value thus set. That is, thevolume setting process shown at (2) in FIG. 6 is carried out in timingof absolute time “2” as shown in FIG. 7.

[0054] The duration information indicative of the duration “01” read outfrom the FIFO 30 together with the event information indicative of“Volume Setting” is delivered to the decoder 32 a. The duration data“01” outputted from the decoder 32 a is added to the count value of theduration forward counter 32 b so that the duration forward counter 32 bcounts up by “1” corresponding to one unit time to provide a count value“3”, to stop the comparison result i from being outputted. The processthen waits for one unit time to elapse, and upon the lapse of one unittime, the absolute time counter 32 c counts up by “1” to provide a countvalue “3”, whereby the count value of the duration forward counter 32 band the count value of the absolute time counter 32 c again become equalto each other and hence the significant comparison result i is againoutputted from the comparator circuit 32 d. This causes eventinformation indicative of “Key On” as well as the next durationinformation indicative of a duration “05” to be read out from the FIFO 3under the control of the FIFO controller 31. The readout eventinformation indicative of “Key On” is converted into event dataindicating an address corresponding to an associated key on parameter bythe decoder 32 a and the converted event data is delivered to theregister write controller 32 e. Then, write data j formed by the key onparameter is written into the tone generator control register of thetone generator 33 at a location indicated by the address of the eventdata. This causes musical tones of a pitch indicated by the key onparameter to be reproduced with the previously set tone colors andvolume by the tone generator 33. That is, the key on process shown at(3) in FIG. 6 is carried out in timing of absolute time “3” as shown inFIG. 7.

[0055] The duration information indicative of the duration “05” read outfrom the FIFO 30 together with the event information indicative of “KeyOn” is delivered to the decoder 32 a. The duration data “05” outputtedfrom the decoder 32 a is added to the count value of the durationforward counter 32 b so that the duration forward counter 32 b counts upby “5” corresponding to five unit times to provide a count value “8”, tostop the comparison result i from being outputted. The process thenwaits for five unit times to elapse, and upon the lapse of five unittimes, the absolute time counter 32 c counts up by “5” to provide acount value “8”, whereby the count value of the duration forward counter32 b and the count value of the absolute time counter 32 c again becomeequal to each other and hence the significant comparison result i isagain outputted from the comparator circuit 32 d. This causes the nextevent information indicative of “Key Off” to be read out from the FIFO 3under the control of the FIFO controller 31. The readout eventinformation indicative of “Key Of f” is converted into event dataindicating an address corresponding to an associated key off parameterby the decoder 32 a and the converted event data is delivered to theregister write controller 32 e. Then, write data j formed by the key offparameter is written into the tone generator control register of thetone generator 33 at a location indicated by the address of the eventdata. This causes a musical tone indicated by the key off parameter andbeing sounded to be keyed off or damped by the tone generator 33. Thatis, the key off process shown at (4) in FIG. 6 is carried out in timingof absolute time “8” as shown in FIG. 7.

[0056] It should be noted that the tone color setting processes shown at(1) in FIG. 6 are carried out for the channels 1 to N. Therefore, if theprocessing speed of the tone generator hardware section 15 is low, thereis a possibility that all the tone color setting processes cannot becompleted within one unit time and may be continued even after the nextunit time is reached. In such a case, according to the conventionalmusical tone reproducing apparatus, as previously described withreference to FIG. 14, there can occur a delay in the timing of soundingof subsequent musical tones. On the other hand, according to the musicaltone reproducing apparatus of the present invention, the timing ofsounding of subsequent musical tones can be restored to the originaltiming. Therefore, even when in the mobile phone 1 an image is displayedon the display section 18, the casing of the mobile phone 1 is vibratedor various buttons of the input section 17 are lighted on and off insynchronism with the reproduction of incoming call music reproduced bythe tone generator hardware section 15, a delay in the sounding timingof the incoming call music can be eliminated to again bring theseoperations into synchronism with the reproduction of the incoming callmusic.

[0057] More specifically, as shown in FIG. 8, even if the processingtime of the process shown at (1) in the figure extends beyond theabsolute time “2”, the absolute time counter 32 c counts up in timing ofthe absolute time “2” to provide a new count value “2”. Thus, the countvalue of the duration forward counter 32 b and the count value of theabsolute time counter 32 c become equal to each other, so that thecomparator circuit 32 s outputs the significant comparison result i. Inthis case, the event information indicative of “Volume Setting” as thenext event data shown at (2) is read out from the FIFO 30 under thecontrol of the FIFO controller 31 together with the next duration dataindicative of the duration “01”. But, at this time, all the event datafor the tone color setting processes shown at (1) have not been read outyet. Accordingly, immediately when all the event data for the tone colorsetting processes shown at (1) are read out from the FIFO 30, the eventinformation indicative of “Volume Setting” and the next duration dataindicative of the duration “01” shown at (2) are read out. Consequently,the volume setting process shown at (2) in FIG. 8 is carried outcontinuously from the execution of the tone color setting process shownat (1), and the volume setting process shown at (2) is completed beforethe time indicated by the absolute time “3” is reached. Accordingly, thekey-on process shown at (3) and the key-off process shown at (4) arecarried out in proper timing. Thus, a delay in the musical tone sounding(damping) timing can be eliminated to restore proper timing.

[0058] Next, FIG. 9 is a flow chart showing a reproduction processcarried out by the tone generator hardware section 15 of the musicaltone reproducing apparatus according to the present embodiment.

[0059] If the mobile phone to which the musical tone reproducingapparatus according to the present invention is applied is set such thatmusic informing of an incoming call is reproduced, an instruction formusical tone reproduction is issued upon receipt of an incoming call tostart the reproduction process in FIG. 9. In a step S1, initializationprocessing carried out such that the count values of the durationforward counter 32 b and the absolute time counter 32 c are reset andthe tone generator control register within the tone generator 33 isreset or set to default values, and so forth. Then, a control registerprocess in a step S2, a sounding process in a step S3, and an absolutetime updating process in a step s4 are carried out in parallel. Theprocesses in these steps S2 to S4 are repeatedly carried out until theprocessing of the entire sequence data is completed or an instructionfor stopping the processes is issued, whereby musical tones arereproduced based on the sequence data and sounded.

[0060] In the control register process in the step S2, a process ofreading out event information from the FIFO 30 and writing write dataconverted from the event information into the tone generator controlregister is repeatedly carried out whenever the count value of theabsolute time counter 32 c becomes equal to or more than the count valueof the duration forward counter 32 b. In the sounding process in thestep S3, a musical tone reproducing process based on tone generatorparameters read out from the tone generator control register isrepeatedly carried out whenever a tone generator parameter is writteninto the tone generator control register. In the absolute time updatingprocess in the step S4, a process of counting up by “1” the absolutetime counter 32 c is carried out every unit time.

[0061]FIG. 10 is a flow chart showing the absolute time updatingprocess.

[0062] After an instruction for starting the musical tone reproductionis issued and the initialization processing is carried out, the absolutetime updating process in FIG. 10 is started. In a step S10, it isdetermined whether or not one unit time, which is a constant timeperiod, has elapsed. If the one unit time has not elapsed, the processimmediately returns to a location immediately after the step S1 of thereproduction process, whereas, if the one unit time has elapsed, theprocess proceeds to a step S11, wherein the count value of the absolutetime counter 32 c, which has been reset to “0” by the initializationprocessing, is incremented into a count value “1”. Then, the processreturns to the step S10, whereby the present absolute time updatingprocess is repeatedly executed so that whenever the constant time periodelapses, the absolute time counter 32 c counts up to increment its countvalue.

[0063]FIG. 11 is a flow chart showing the control register writeprocess.

[0064] After the instruction for starting the musical tone reproductionis issued and the initialization processing is carried out, the controlregister write process in FIG. 11 is started. In a step S20, sequencedata is read out from the FIFO 30. In this case, the readout sequencedata is duration information, and in a step S21 duration data outputtedfrom the decoder 32 a is added to the count value of the durationforward counter 32 b, which has been reset to “0” by the initializationprocessing. Then, in a step S22, the count value of the absolute timecounter 32 c and the count value of the duration forward counter 32 bare compared with each other. If the comparison result does not showthat the count value of the absolute time counter 32 c is equal to ormore than the count value of the duration forward counter 32 b, theprocess waits for a new comparison result. When the count value of theabsolute time counter 32 c is incremented by the above describedabsolute time updating process so that it becomes equal to or more thanthe count value of the duration forward counter 32 b, the processproceeds to a step S23, wherein the significant comparison result i isapplied to the FIFO controller 31, whereby event informationcorresponding to the duration data is read out from the FIFO 30. Thereadout event information is converted by the decoder 32 a into controldata of a format peculiar to the tone generator 33 and the convertedcontrol data is delivered to the register write controller 32 e. Then,in a step S24, a tone generator parameter contained in the control datais written into the tone generator control register at a locationindicated by an address contained in the control data. After completionof the process in the step S24, the process returns to the locationimmediately after the step SI of the reproduction process. In this way,preparations are made for reproducing a musical tone based on thecontrol data.

[0065]FIG. 12 is a flow chart showing the sounding process.

[0066] After the instruction for starting the musical tone reproductionis issued and the initialization processing is carried out, and then atone generator parameter is written into the tone generator controlregister by the above described control register write process,preparations have been made for reproducing a musical tone, andaccordingly the sounding process is started. In a step S30, the tonegenerator parameter is read out from the tone generator controlregister. Then, in a step S31, data processing is carried out based onthe readout tone generator parameter. In this case, if the tonegenerator parameter is a key-on parameter, data processing is carriedout to reproduce a musical tone of a pitch indicated by the key-onparameter with one or more tone colors and volume previously set. Then,in a step S32, data resulting from the data processing is outputted. Inthis case, if the tone generator parameter is a key-on parameter,reproducing data k for the musical tone to be reproduced is outputted.After completion of the processing in the step S32, the process returnsto the location immediately after the step S1 of the reproductionprocess.

[0067] Although the musical tone reproducing apparatus according to thepresent invention described above is applied to a mobile phone as aportable terminal apparatus, the present invention is not limited tothis, but the present invention may be applied to a portable informationapparatus capable of outputting musical tones, a portable personalcomputer capable of outputting musical tones, and the like. Further,music contents data may be reproduced in synchronism with texts or imagecontents data.

[0068] Further, although in the above described embodiment, the decoder32 a of the tone generator hardware section 15 converts sequence datainto control data having a format peculiar to the tone generator 33,insofar as the CPU 10 has a surplus capacity, it may be so arranged thatthe CPU 10 converts sequence data into control data having a formatpeculiar to the tone generator 33 and stores the same in the RAM 11,while the CPU 10 reads out the data from the RAM 11 and supplies thesame to the tone generator control section 15 during reproduction.

[0069] This reduces the whole processing amount of the sequencer 32 andhence can shorten the time period required for processing data relatedto the musical tone reproduction by the sequencer 32. Therefore, bycombining the conversion processing by the CPU 10 and the processing ofsupplying event data from the FIFO 30 to the register write controller32 e when the count values of the absolute time counter 32 c and theduration forward counter 32 b become equal to each other and theprocessing of writing the write date j into the tone generator controlregister by the register write controller 32 e, a musical tonereproducing apparatus that is less prone to a delay in the timing ofsounding of musical tones can be provided.

[0070] The tone generator 33 of the tone generator hardware section 15may be formed by a tone generator of the frequency modulation type, i.e.an FM tone generator. The FM tone generator utilizes harmonics generatedby frequency modulation for synthesis of musical tones, and is capableof generating waveforms having harmonic components containingnon-harmonic chords with a simple circuit configuration. The FM tonegenerator is also capable of generating a variety of musical tones fromsynthesized tones simulating tones of natural musical instruments tobleeps. The FM tone generator employs oscillators called “operators”that equivalently oscillate sine waves. For example, the FM tonegenerator may be constituted by a first operator and a second operatorwhich are cascaded with each other. Moreover, the FM tone generator maybe constructed such that an output from an operator is fed back to theinput of the operator.

[0071] The type of the tone generator 33 of the tone generator hardwaresection 5 is not limited to the FM tone generator type, but may be awaveform memory type (PCM tone generator, ADPCM tone generator), aphysical model type, and so forth. In terms of the construction, ahardware tone generator using a DSP or the like may be employed.

Industrial Applicability

[0072] As described above, according to the present invention, when thecount value of the time counter means becomes equal to or more than thecount value of the forward counter means, control data generated fromcorresponding event information is supplied to the tone generator means.Therefore, even if a temporary delay occurs in the timing of supply ofthe control data in the course of musical tone reproduction, thereafterthe control data can be supplied to the tone generator in timingindicated by duration information. As a result, the timing of soundingof musical tones reproduced by the tone generator can be restored toproper or original timing.

[0073] Therefore, even when in a mobile phone to which the presentinvention is applied, an image is displayed, the casing of the mobilephone is vibrated or various buttons are lighted on and off insynchronism with the reproduction of incoming call music, a delay in thesounding timing of musical tones can be eliminated to again bring theseoperations into synchronism with the reproduction of the generation ofmusical tones.

What is claimed is:
 1. A musical tone reproducing apparatus forperforming reproduction of musical tones based on performance datacomprising event information representative of contents of events andduration information representative of time intervals between occurrenceof events and occurrence of preceding events, comprising: forwardcounter means for accumulating the duration information of theperformance data sequentially supplied thereto to indicate time at whichmusical tones are to be generated based on the event informationcorresponding to the duration information; time counter means forcounting up at intervals of a unit time to indicate absolute time; datagenerating means operable when a count value of said time counter meansbecomes equal to or more than a count value of said forward countermeans, for generating control data from the event informationcorresponding to the accumulated duration data of the performance data;and tone generator means for generating musical tones based on thecontrol data generated by said data generating means.
 2. A musical tonereproducing apparatus as claimed in claim 1, further comprisingtemporary storage means, and system control means for carrying out aprocess other than a musical tone reproducing process as a main process,and wherein, when musical tones are to be reproduced, said systemcontrol means sequentially transfers the performance data by apredetermined amount to said temporary storage means, and sequentiallyreads out the performance data from said temporary storage means.
 3. Aportable terminal apparatus having a musical tone reproducing apparatusas claimed in claim 2, wherein said system control means carries out aportable terminal function process as the main process.
 4. A musicaltone reproducing apparatus as claimed in claim 2, further comprising:temporary storage means control means for controlling said temporarystorage means to read out the performance data and transfer the readoutperformance data to said data generating means when the count value ofsaid time counter means becomes equal to or more than the count value ofsaid forward counter means.
 5. A musical tone reproducing method ofperforming reproduction of musical tones based on performance datacomprising event information representative of contents of events andduration information representative of time intervals between occurrenceof events and occurrence of preceding events, comprising the steps of:accumulating the duration information of the performance datasequentially supplied to determine time at which musical tones are to begenerated based on the event information corresponding to the durationinformation; counting up at intervals of a unit time to indicateabsolute time; generating control data from the event informationcorresponding to the accumulated duration data of the performance datawhen the determined absolute time becomes equal to or later than thedetermined time; and causing a tone generator to generate musical tonesbased on the generated control data.